package Day05;

import java.util.Scanner;

public class MethodDemo1 {
    private static int sum=1;
    public static void main(String[] args) {
        String name;
        int age;
        Scanner sc = new Scanner(System.in);
        say();
        System.out.println("----------");
        say("syx",24);
        say("syx",24.0);
        say("sy",1000);


    }


    //重载overload
    public static void say(String name,int age){

        if(age>60){
            System.out.println("gg");
            return;
        }
        System.out.println("大家好,我叫" + name + ",今年" + age + "岁了");
    }



    public static void say(){
        sum += 1;
        System.out.println("helow");
//        if(sum==3){
//            sum = 1;
//            return;
//        }
//        MethodDemo1.say();
    }


    //错误与形参名字无关,类型有关
    public static void say(String a,double b){
        System.out.println("doulble");

    }

    //编译错误重载与返回值无关只与函数名有关
//    public static int say(){
//        return 1;
//    }
}
